local mangqing = fk.CreateSkill {
    name = "kq__mangqing",
}

Fk:loadTranslationTable {
    ["kq__mangqing"] = "氓情",
    [":kq__mangqing"] = "当你需要使用或打出一张【杀】或【闪】时，你可以展示一张装备牌令对方使用之，"..
    "然后你视为使用或打出一张【杀】或【闪】并摸两张牌。",
}

mangqing:addEffect(fk.TargetConfirmed, {
    can_trigger = function (self, event, target, player, data)
        if target == player and player:hasSkill(mangqing.name) then
            player:setMark("@mangqing", data.from.id)
        end
    end
})

mangqing:addEffect(fk.TargetSpecified, {
    can_trigger = function (self, event, target, player, data)
        if target == player and player:hasSkill(mangqing.name) then
            player:setMark("@mangqing", data.to.id)
        end
    end
})

mangqing:addEffect("viewas", {
    pattern = "slash,jink",
    mute_card = false,
    interaction = function(self, player)
        local all_names = {"slash", "jink"}
        local names = player:getViewAsCardNames(mangqing.name, all_names)
        if #names == 0 then return end
        return UI.CardNameBox {choices = names, all_choices = all_names}
    end,
    handly_pile = true,
    card_filter = function(self, player, to_select, selected)
        return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip
    end,
    before_use = function (self, player, use)
        local room = player.room
        local cards = use.card:getMark(mangqing.name)
        use.card:setMark(mangqing.name, 0)
        player:showCards(cards)
        local target
        if #use.tos > 0 then target = use.tos[1]
        else target = room:getPlayerById(player:getMark("@mangqing")) end
        room:useCard {from  = target, tos = {target}, card = Fk:getCardById(cards[1])}
        player:drawCards(2, mangqing.name)
    end,
    view_as = function (self, player, cards)
        if #cards ~= 1 or not self.interaction.data then return end
        local card = Fk:cloneCard(self.interaction.data)
        card:setMark(mangqing.name, cards)
        card.skillName = mangqing.name
        return card
    end,
    enabled_at_play = function(self, player)
        return not player:isNude()
    end,
    enabled_at_response = function(self, player, cardResponsing)
        return not player:isNude()
    end,
})

return mangqing